package com.zy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zy.entity.UserWorkStatus;
import com.zy.entity.WorkTime;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.HashMap;

@Repository
@Mapper
public interface UserWorkStatusManageMapper extends BaseMapper<UserWorkStatus> {

    //查询用户考勤信息
    IPage<UserWorkStatus> listUserWorkStatus(IPage<UserWorkStatus> iPage, @Param("map") HashMap map);

    //删除考勤信息
    @Delete("delete from work where id = #{statusId}")
    void deleteUserWorkStatus(Integer statusId);

    //查询考勤时间
    @Select("select * from work_time")
    WorkTime getWorkTime();

    //修改考勤时间
    @Update("update work_time set on_work=#{onWork}, off_work=#{offWork}")
    void modifyWorkTime(String onWork, String offWork);

}